#!/usr/bin/env python
# -*- coding: utf-8 -*-

import sys, os

dirpath = os.path.dirname(os.path.abspath(__file__))
sys.path.append(dirpath)
sys.path.append(os.path.join(dirpath, '../'))
from htmlparser2 import SingleTagParser

htmlbody="""
<html>
<title>test</title>
<body>
<input type="hidden" name="JP" value="Japan"/>
<input type="hidden" name="EU"/>
<input type="checkbox" name="CN" value="China"/>
<input type="textarea" name="UK" value="England">
Hello world!
</input>
</body>
</html>
"""


#条件設定
cond = {}
cond["type"] = "hidden"

parser = SingleTagParser('input', cond)
parser.feed(htmlbody.replace('\r', '').replace('\n', ''))
parser.close()
print parser.get_dict_name_value()
params =  parser.get_dict_name_value()
